package co.com.jtune.view.main;

import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class PlayListPanel extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private JTable musicList;
	private JButton ejemplo;

	//Constructor por defecto
	public PlayListPanel()
	{
		setLayout(new GridBagLayout());
		
		buildTable();
		ejemplo = new JButton("Sabine");
		ejemplo.addActionListener(new ActionListener() {
			
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showMessageDialog(getParent(), "Sabine andres te ama");
				
			}
		});
//		
		add(ejemplo);
		
				
	}

	public void buildTable() {
		String[] columnNames = {"Nombre",
				 "Genero",
				 "Duracion",
				 "Artista",
				 "puntuacion"};

		
		DefaultTableModel model = new DefaultTableModel(columnNames, 5);
		musicList = new JTable(model);
		add(musicList);
	}
}
